<?php
class AdminLoginFilter extends CFilter{
	protected function preFilter($filterChain)
    {
       
    	// logic being applied before the action is executed
       if(!isset(yii::app()->session['admin'])){
        	$filterChain->controller->redirect(array('admin/login','mess'=>'您还没有登录,请登录.'));
        }
    	return true; // false if the action should not be executed
    }
 
    protected function postFilter($filterChain)
    {
        // logic being applied after the action is executed
    }
	
}
?>